 package com.ghbank.rdws.common.utils;

import java.io.Serializable;

import org.hibernate.MappingException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentityGenerator;

import com.ghbank.rdws.common.uid.UidGenerator;

public class CustomIDGenerator extends IdentityGenerator {
    @Override
    public Serializable generate(SharedSessionContractImplementor session, Object object) throws MappingException {
        UidGenerator cachedUidGenerator = (UidGenerator)SpringContextUtils.getBean("cachedUidGenerator");
        return (Serializable)cachedUidGenerator.getUID();
    } 
}
